import request from '@/utils/request'

// 查询成本核算列表
export function listPricing(query) {
  return request({
    url: '/quotation/pricing/list',
    method: 'get',
    params: query
  })
}

// 查询成本核算详细信息
export function getPricing(id) {
  return request({
    url: '/quotation/pricing/' + id,
    method: 'get'
  })
}

// 根据订单编号查询成本核算信息
export function getPricingByOrderNo(orderNo) {
  return request({
    url: '/quotation/pricing/byOrderNo/' + orderNo,
    method: 'get'
  })
}

// 新增成本核算
export function addPricing(data) {
  return request({
    url: '/quotation/pricing',
    method: 'post',
    data: data
  })
}

// 修改成本核算
export function updatePricing(data) {
  return request({
    url: '/quotation/pricing',
    method: 'put',
    data: data
  })
}

// 删除成本核算
export function delPricing(ids) {
  return request({
    url: '/quotation/pricing/' + ids,
    method: 'delete'
  })
}

// 执行财务审核
export function auditPricing(data) {
  return request({
    url: '/quotation/pricing/audit',
    method: 'post',
    data: data
  })
}

// 财务反审核
export function reauditPricing(data) {
  return request({
    url: '/quotation/pricing/reaudit',
    method: 'post',
    data: data
  })
}

// 计算价格
export function calculatePrice(query) {
  return request({
    url: '/quotation/pricing/calculate',
    method: 'get',
    params: query
  })
}

// 导出成本核算
export function exportPricing(query) {
  return request({
    url: '/quotation/pricing/export',
    method: 'post',
    params: query
  })
} 